/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2020-02-17
*/
package com.rzico.account.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.rzico.annotation.IgnoreSwaggerParameter;
import com.rzico.basics.entity.Member;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;

/**
 * <pre>
 *   付款单数据库对象
 * </pre>
 * @author Rzico Boot
 * @version 1.0
 */
@Data
@JsonIgnoreProperties(value = {"handler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "wx_transfer")
public class Transfer {
    @ApiModelProperty(value = "")
    @Id
    protected Long id;

    @ApiModelProperty(value = "创建日期")
    protected java.util.Date createDate;

    @ApiModelProperty(value = "修改日期")
    protected java.util.Date modifyDate;

    @ApiModelProperty(value = "付款金额")
    protected java.math.BigDecimal amount;

    @ApiModelProperty(value = "手续费")
    protected java.math.BigDecimal fee;

    @ApiModelProperty(value = "备注")
    protected String memo;

    @ApiModelProperty(value = "付款日期")
    protected java.util.Date paymentDate;

    @ApiModelProperty(value = "付款单号")
    protected String sn;

    @ApiModelProperty(value = "会员Id")
    protected Long memberId;

    @ApiModelProperty(value = "供应商")
    protected Long supplierId;

    @ApiModelProperty(value = "应付款ID")
    protected Long payableId;

    @ApiModelProperty(value = "付款凭证号(第三方ID)")
    protected String tranSn;

    @ApiModelProperty(value = "归属企业")
    protected Long enterpriseId;

    @ApiModelProperty(value = "付款人")
    protected String employeeId;

    @ApiModelProperty(value = "创建者")
    protected String createBy;

    @ApiModelProperty(value = "更新者")
    protected String modifyBy;

    @ApiModelProperty(value = "类型 {0:付款,1:退款,2:冲账,3.提现}")
    protected Integer type;

    @ApiModelProperty(value = "状态 {0:等待付款,1.确认付款,2:付款完成,3:付款失败,4.取消付款}")
    protected Integer status;

    @ApiModelProperty(value = "类型 {0:付款,1:退款,2:冲账}")
    protected Boolean deleted;

    @ApiModelProperty(value = "付款插件")
    protected String paymentPluginId;

    @ApiModelProperty(value = "付款插件名称")
    protected String paymentPluginName;

    @ApiModelProperty(value = "收款人卡号")
    protected String bank_code;

    @ApiModelProperty(value = "收款人姓名")
    protected String bank_name;

    @ApiModelProperty(value = "银行编号")
    protected String bank_num;

    @ApiModelProperty(value = "付款类型 {0:订单付款}")
    protected Integer orderType;

    @ApiModelProperty(value = "订单ID")
    protected Long orderId;

    @ApiModelProperty(value = "订单号")
    protected String orderSn;


    /**
     *  会员
     */
    @JsonIgnore
    @IgnoreSwaggerParameter
    protected Member member;



    public String getName() {
        Member member = getMember();
        if (member!=null) {
            return member.getName();
        } else {
            return null;
        }
    }

    public String getMobile() {
        Member member = getMember();
        if (member!=null) {
            return member.getMobile();
        } else {
            return null;
        }
    }


}
